package com.bwie.redkids.app;

import java.util.Stack;

import android.app.Activity;

public class ActivityManager {
	private Stack<Activity> mActivity;

	public ActivityManager() {
		super();
		mActivity = new Stack<Activity>();
	}

	public void SaveActivity(Activity activity) {
		if (mActivity == null) {

			mActivity = new Stack<Activity>();

		}
		mActivity.add(activity);

	}

	/**
	 * 循环将activity finish掉
	 * */
	public void RemoveActivity() {
		if (mActivity != null) {
			for (int i = 0; i < mActivity.size(); i++) {
				mActivity.get(i).finish();
				mActivity.clear();
			}
			mActivity.clear();
			System.exit(0);
		}
	}
}
